<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
    <div class="layui-card-body">

        <div class="layui-form-item">
            <label class="layui-form-label">上级地址</label>
            <div class="layui-input-block">
                <select name='pid' class='layui-select' lay-search {if !$is_custom}disabled{/if}>
                    <!--{foreach $menus as $menu}-->
                    <!--{eq name='menu.id' value='$vo.pid|default=0'}-->
                    <option selected value='{$menu.id}'>{$menu.name}</option>
                    <!--{else}-->
                    <option value='{$menu.id}'>{$menu.name}</option>
                    <!--{/eq}-->
                    <!--{/foreach}-->
                </select>
                <p class="help-block">必选，请选择上级地址</p>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label label-required">地址名称</label>
            <div class="layui-input-block">
                <input type="text" required autocomplete="off" autofocus name="name" value='{$vo.name|default=""}' placeholder="请输入名称" class="layui-input">
                <!--<p class="color-desc">可选，用户姓名</p>-->
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">联系人姓名</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" autofocus name="contact_name" value='{$vo.contact_name|default=""}' placeholder="请输入联系人姓名" class="layui-input">
                <!--<p class="color-desc">可选，用户姓名</p>-->
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">联系人电话</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" autofocus name="contact_phone" value='{$vo.contact_phone|default=""}' placeholder="请输入联系人电话" class="layui-input">
                <!--<p class="color-desc">可选，用户姓名</p>-->
            </div>
        </div>
        <!--<div class="layui-form-item">-->
            <!--<label class="layui-form-label">地址编码</label>-->
            <!--<div class="layui-input-block">-->
                <!--<input type="text" autocomplete="off" name="adcode" value='{$vo.adcode|default=""}' placeholder="请输入编码" class="layui-input">-->
                <!--&lt;!&ndash;<p class="color-desc">可选，用户姓名</p>&ndash;&gt;-->
            <!--</div>-->
        <!--</div>-->
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">经度</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="lng" value='{$vo.lng|default=""}' placeholder="请输入经度" autocomplete="off" class="layui-input">
                </div>

            </div>

            <div class="layui-inline">
                <label class="layui-form-label">维度</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="text" name="lat" value='{$vo.lat|default=""}' placeholder="请输入维度" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <!--<p class="color-desc">不知道经纬度？<a href="http://api.map.baidu.com/lbsapi/getpoint/index.html" target="_blank">坐标拾取</a></p>-->
                <p class="color-desc">
                    <!--<a data-title="选择地址" data-modal='{:url("choose_position")}'>选择位置</a>-->
                    <a href="javascript:void(0)" onclick="choosePosition()">选择位置</a>
                </p>

            </div>

        </div>
    </div>
    <div class="hr-line-dashed"></div>
    <div class="layui-form-item text-center">
        {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
        {notempty name='vo.level'}<input type='hidden' value='{$vo.level}' name='level'>{/notempty}
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
    <script>
        window.form.render();
        function choosePosition() {
            window.layer.open({
                type: 2,
                title: '选择地址',
                area: ['750px', '480px'],
                content: '{:url("cleaner/choose_position")}'
            })
        }
    </script>
</form>
